package com.lagou.rpc.consumer.loadbalance.impl;

import com.lagou.rpc.consumer.loadbalance.AbstractLoadBalance;

import java.util.List;
import java.util.Random;

/**
 * 随机负载策略
 */
public class RandomLoadBalance extends AbstractLoadBalance {
    @Override
    protected  String doSelect(List<String> list) {
        Random random = new Random();
        return list.get(random.nextInt(list.size()));
    }

}
